 <?php include 'system/application/views/header.php' ?>
<table class='content-middle' align='center'>
            <tr>
                <td style="padding-right: 10px;">
                    <!-- content -->
                    <h2 class="title-master"><?php echo $page['PageTitle']?></h2>
                    <hr>                    
                    <div class="news-content">
                    	<p>
                    		<?php echo $page['PageDetail']?>
                    	</p>
                    	<div class="form-register">
                    		<form method="post" id="frm_register" action="<?php echo base_url()?>tham_gia_ngay_hoi">
                    			<div class="content-form">
                    				<img alt="" src="<?php echo base_url()?>media/images/form_top.png">
                    				<table cellpadding="0" cellspacing="0">
                    					<?php if(!empty($msg)):?>
                    					<tr>
                    						<td colspan="6" class="msg_alert"><?php echo $msg?></td>
                    					</tr>
                    					<?php endif;?>
                    					<tr>
                    						<td colspan="6" style="text-align: right;">Vui lòng nhập đúng thông tin những vị trí có dấu (*)</td>
                    					</tr>
                    					<tr>
                    						<td>Đơn vị tham gia(*)</td>
                    						<td colspan="5"><div class="input-corner"><input type="text" id="Company" name="Company" /></div></td>
                    					</tr>
                    					<tr>
                    						<td>Địa chỉ</td>
                    						<td colspan="5"><input type="text" name="Address" id="Address" /></td>
                    					</tr>
                    					<tr>
                    						<td>Điện thoại</td>
                    						<td><input type="text" name="Phone" id="Phone" /></td>
                    						<td>Fax</td>
                    						<td colspan="3"><input type="text" name="Fax" id="Fax" /></td>
                    					</tr>
                    					<tr>
                    						<td>Email(*)</td>
                    						<td><input type="text" name="Email" id="Email"/></td>
                    						<td>Website</td>
                    						<td colspan="3"><input type="text" name="Website" id="Website"/></td>
                    					</tr>
                    					<tr>
                    						<td>Người đại diện</td>
                    						<td><input type="text" name="Representative" id="Representative" /></td>
                    						<td>Chức vụ</td>
                    						<td colspan="3"><input type="text" name="Position"  id="Position"/></td>
                    					</tr>
                    					<tr>
                    						<td>Người liên hệ</td>
                    						<td><input type="text" name="ContactPerson" id="ContactPerson" /></td>
                    						<td>Chức vụ</td>
                    						<td><input type="text" name="ContactPosition" id="ContactPosition" /></td>
                    						<td>ĐTDĐ</td>
                    						<td><input type="text" name="Mobile" id="Mobile" /></td>
                    					</tr>
                    					<tr>
                    						<td colspan="6">Sản phẩm chính trưng bày tại ngày hội</td>
                    					</tr>
                    					<tr>
                    						<td colspan="6"><textarea rows="" cols="" name="Content" id="Content"></textarea> </td>
                    					</tr>
                    					<tr>
                    						<td colspan="6" style="text-align: right;">
                    							<span id="btnReset">Làm lại</span>
												<span id="btnSave">Gửi</span>
                    						</td>
                    					</tr>
                    				</table>
                    			</div>
                    		</form>
                    	</div>
                    </div>
                </td>
            </tr>
        </table>
            <script>
           // $(document).ready(function(){
            	$('#btnReset').corner("round 8px");
            	$('#btnSave').corner("round 8px");
            	$("#btnSave").click(function(){
            		if(validateReg()){
                		$("#frm_register").submit();
            		}
                });
                $("#btnReset").click(function(){
                	$("#frm_register")[0].reset();
                });
                
                function validateReg(){
					if($("#Company").val() == ""){
						alert("Vui lòng nhập đơn vị tham gia");
						$("#Company").focus();
						return false;
					}
					if($("#Email").val() == "" || !checkEmail($("#Email").val())){
						alert("Vui lòng nhập email đúng");
						$("#Email").focus();
						return false;
					}
					return true;
                }
                function checkEmail(email){
                	var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
                	return filter.test(email);		
				}
                
           // });
            </script>    
                    <?php include 'system/application/views/footer.php' ?>